package com.memo4android.ui;

import android.content.Context;
import android.graphics.Color;
import android.widget.Button;

import com.memo4android.R;
import com.memo4android.model.ItemTodoList;

public class TodoListButton extends Button {
	private ItemTodoList Tdl;

	public TodoListButton(Context context, ItemTodoList Itdl) {
		super(context);
		this.Tdl = Itdl;
		this.setText(Tdl.getTitre());
		this.setPadding(5, 5, 5, 5);
		this.setTextColor(Color.BLACK);
		if(Itdl.getPriorite().equals(ItemTodoList.FAIBLE))
			this.setBackgroundResource(R.drawable.dossier_vert);
		else if(Itdl.getPriorite().equals(ItemTodoList.MOYENNE))
			this.setBackgroundResource(R.drawable.dossier_orange);
		else if(Itdl.getPriorite().equals(ItemTodoList.FORTE))
			this.setBackgroundResource(R.drawable.dossier_rouge);
	}
	
	public ItemTodoList getTodoList() {
		return Tdl;
	}
	
}
